include("shared.lua")
include("sv_users.lua")

function DSA_Initialize()
	local ERROR = nil
	if(!sql.TableExists("dsa_users")) then sql_query("CREATE TABLE dsa_users (unique_id varchar(255), rank varchar(255))")	end
	if(!sql.TableExists("dsa_ranks")) then 
		sql_query("CREATE TABLE dsa_ranks (unique_id varchar(255), name varchar(255), color varchar(255))")	
		sql_query("INSERT INTO dsa_ranks (unique_id, name, color) VALUES ('0', 'Guest', '122,122,122,255')")
		sql_query("INSERT INTO dsa_ranks (unique_id, name, color) VALUES ('1', 'Respected', '122,0,122,255')")
		sql_query("INSERT INTO dsa_ranks (unique_id, name, color) VALUES ('2', 'VIP', '255,0,122,255')")
		sql_query("INSERT INTO dsa_ranks (unique_id, name, color) VALUES ('3', 'Helper', '122,0,122,255')")
		sql_query("INSERT INTO dsa_ranks (unique_id, name, color) VALUES ('4', 'Moderator', '122,0,122,255')")
		sql_query("INSERT INTO dsa_ranks (unique_id, name, color) VALUES ('5', 'Administrator', '0,255,0,255')")
	end
	
	--hook.Add("PlayerConnect", "KEV_PlayerConnect", KEV_PlayerConnect)
	hook.Add("PlayerInitialSpawn", "DSA_PlayerInitialSpawn", DSA_PlayerInitialSpawn)
	
end

DSA_Initialize()